package cc.laop.controller;

import cc.laop.business.system.UserBusiness;
import cc.laop.entity.system.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("user")
public class UserSyncController {

	@Autowired
	private UserBusiness userBusiness;

	@RequestMapping(value = "sync.do", method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> sync(User user, String authCode, int type) {
		Map<String, Object> map = new HashMap<String, Object>();
		int result = userBusiness.userSync(user, authCode, type);
		map.put("result", result);
		return map;
	}

}
